﻿using System.Collections;
using UnityEngine;

using moai_kun_v2;

public class NPC : MonoBehaviour
{
    private void OnTriggerEnter2D(Collider2D collision)
    {
        var player=collision.GetComponent<MainActor>();
        if (player) 
        {
            LevelManager.Instance.GetNPC();
            Destroy(this.gameObject);
        }
        
    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        var player = collision.gameObject.GetComponent<MainActor>();
        if (player)
        {
            AudioManager.Instance.PlaySound(SoundType.Catch);
            LevelManager.Instance.GetNPC();
            Destroy(this.gameObject);
        }
    }

}
